home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / uriloader / nsIURILoader.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  8KB  |  196 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIURILoader.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIURILoader_h__
  6. #define __gen_nsIURILoader_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIURIContentListener; /* forward declaration */
  18.  
  19. class nsIURI; /* forward declaration */
  20.  
  21. class nsILoadGroup; /* forward declaration */
  22.  
  23. class nsIProgressEventSink; /* forward declaration */
  24.  
  25. class nsIChannel; /* forward declaration */
  26.  
  27. class nsIRequest; /* forward declaration */
  28.  
  29. class nsIStreamListener; /* forward declaration */
  30.  
  31. class nsIInputStream; /* forward declaration */
  32.  
  33. class nsIInterfaceRequestor; /* forward declaration */
  34.  
  35.  
  36. /* starting interface:    nsIURILoader */
  37. #define NS_IURILOADER_IID_STR "5cf6420c-74f3-4a7c-bc1d-f5756d79ea07"
  38.  
  39. #define NS_IURILOADER_IID \
  40.   {0x5cf6420c, 0x74f3, 0x4a7c, \
  41.     { 0xbc, 0x1d, 0xf5, 0x75, 0x6d, 0x79, 0xea, 0x07 }}
  42.  
  43. /**
  44.  * The uri dispatcher is responsible for taking uri's, determining
  45.  * the content and routing the opened url to the correct content 
  46.  * handler. 
  47.  *
  48.  * When you encounter a url you want to open, you typically call 
  49.  * openURI, passing it the content listener for the window the uri is 
  50.  * originating from. The uri dispatcher opens the url to discover the 
  51.  * content type. It then gives the content listener first crack at 
  52.  * handling the content. If it doesn't want it, the dispatcher tries
  53.  * to hand it off one of the registered content listeners. This allows
  54.  * running applications the chance to jump in and handle the content.
  55.  *
  56.  * If that also fails, then the uri dispatcher goes to the registry
  57.  * looking for the preferred content handler for the content type
  58.  * of the uri. The content handler may create an app instance
  59.  * or it may hand the contents off to a platform specific plugin
  60.  * or helper app. Or it may hand the url off to an OS registered 
  61.  * application. 
  62.  */
  63. class NS_NO_VTABLE nsIURILoader : public nsISupports {
  64.  public: 
  65.  
  66.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IURILOADER_IID)
  67.  
  68.   /**
  69.    * As applications such as messenger and the browser are instantiated,
  70.    * they register content listener's with the uri dispatcher corresponding
  71.    * to content windows within that application. 
  72.    *
  73.    * Note to self: we may want to optimize things a bit more by requiring
  74.    * the content types the registered content listener cares about.
  75.    *
  76.    * @param aContentListener the listener to register
  77.    *
  78.    * @see the nsIURILoader class description
  79.    */
  80.   /* void registerContentListener (in nsIURIContentListener aContentListener); */
  81.   NS_IMETHOD RegisterContentListener(nsIURIContentListener *aContentListener) = 0;
  82.  
  83.   /* void unRegisterContentListener (in nsIURIContentListener aContentListener); */
  84.   NS_IMETHOD UnRegisterContentListener(nsIURIContentListener *aContentListener) = 0;
  85.  
  86.   /**
  87.    * OpenURI requires the following parameters.....
  88.    * @param aChannel
  89.    *        The channel that should be opened. This must not be asyncOpen'd yet!
  90.    *        If a loadgroup is set on the channel, it will get replaced with a
  91.    *        different one.
  92.    * @param aIsContentPreferred
  93.    *        Should the content be displayed in a container that prefers the
  94.    *        content-type, or will any container do.
  95.    * @param aWindowContext
  96.    *        If you are running the url from a doc shell or a web shell, this is
  97.    *        your window context. If you have a content listener you want to
  98.    *        give first crack to, the uri loader needs to be able to get it
  99.    *        from the window context. We will also be using the window context
  100.    *        to get at the progress event sink interface.
  101.    *        <b>Must not be null!</b>
  102.    */
  103.   /* void openURI (in nsIChannel aChannel, in boolean aIsContentPreferred, in nsIInterfaceRequestor aWindowContext); */
  104.   NS_IMETHOD OpenURI(nsIChannel *aChannel, PRBool aIsContentPreferred, nsIInterfaceRequestor *aWindowContext) = 0;
  105.  
  106.   /**
  107.    * Stops an in progress load
  108.    */
  109.   /* void stop (in nsISupports aLoadCookie); */
  110.   NS_IMETHOD Stop(nsISupports *aLoadCookie) = 0;
  111.  
  112. };
  113.  
  114. /* Use this macro when declaring classes that implement this interface. */
  115. #define NS_DECL_NSIURILOADER \
  116.   NS_IMETHOD RegisterContentListener(nsIURIContentListener *aContentListener); \
  117.   NS_IMETHOD UnRegisterContentListener(nsIURIContentListener *aContentListener); \
  118.   NS_IMETHOD OpenURI(nsIChannel *aChannel, PRBool aIsContentPreferred, nsIInterfaceRequestor *aWindowContext); \
  119.   NS_IMETHOD Stop(nsISupports *aLoadCookie); 
  120.  
  121. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  122. #define NS_FORWARD_NSIURILOADER(_to) \
  123.   NS_IMETHOD RegisterContentListener(nsIURIContentListener *aContentListener) { return _to RegisterContentListener(aContentListener); } \
  124.   NS_IMETHOD UnRegisterContentListener(nsIURIContentListener *aContentListener) { return _to UnRegisterContentListener(aContentListener); } \
  125.   NS_IMETHOD OpenURI(nsIChannel *aChannel, PRBool aIsContentPreferred, nsIInterfaceRequestor *aWindowContext) { return _to OpenURI(aChannel, aIsContentPreferred, aWindowContext); } \
  126.   NS_IMETHOD Stop(nsISupports *aLoadCookie) { return _to Stop(aLoadCookie); } 
  127.  
  128. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  129. #define NS_FORWARD_SAFE_NSIURILOADER(_to) \
  130.   NS_IMETHOD RegisterContentListener(nsIURIContentListener *aContentListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterContentListener(aContentListener); } \
  131.   NS_IMETHOD UnRegisterContentListener(nsIURIContentListener *aContentListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnRegisterContentListener(aContentListener); } \
  132.   NS_IMETHOD OpenURI(nsIChannel *aChannel, PRBool aIsContentPreferred, nsIInterfaceRequestor *aWindowContext) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenURI(aChannel, aIsContentPreferred, aWindowContext); } \
  133.   NS_IMETHOD Stop(nsISupports *aLoadCookie) { return !_to ? NS_ERROR_NULL_POINTER : _to->Stop(aLoadCookie); } 
  134.  
  135. #if 0
  136. /* Use the code below as a template for the implementation class for this interface. */
  137.  
  138. /* Header file */
  139. class nsURILoader : public nsIURILoader
  140. {
  141. public:
  142.   NS_DECL_ISUPPORTS
  143.   NS_DECL_NSIURILOADER
  144.  
  145.   nsURILoader();
  146.  
  147. private:
  148.   ~nsURILoader();
  149.  
  150. protected:
  151.   /* additional members */
  152. };
  153.  
  154. /* Implementation file */
  155. NS_IMPL_ISUPPORTS1(nsURILoader, nsIURILoader)
  156.  
  157. nsURILoader::nsURILoader()
  158. {
  159.   /* member initializers and constructor code */
  160. }
  161.  
  162. nsURILoader::~nsURILoader()
  163. {
  164.   /* destructor code */
  165. }
  166.  
  167. /* void registerContentListener (in nsIURIContentListener aContentListener); */
  168. NS_IMETHODIMP nsURILoader::RegisterContentListener(nsIURIContentListener *aContentListener)
  169. {
  170.     return NS_ERROR_NOT_IMPLEMENTED;
  171. }
  172.  
  173. /* void unRegisterContentListener (in nsIURIContentListener aContentListener); */
  174. NS_IMETHODIMP nsURILoader::UnRegisterContentListener(nsIURIContentListener *aContentListener)
  175. {
  176.     return NS_ERROR_NOT_IMPLEMENTED;
  177. }
  178.  
  179. /* void openURI (in nsIChannel aChannel, in boolean aIsContentPreferred, in nsIInterfaceRequestor aWindowContext); */
  180. NS_IMETHODIMP nsURILoader::OpenURI(nsIChannel *aChannel, PRBool aIsContentPreferred, nsIInterfaceRequestor *aWindowContext)
  181. {
  182.     return NS_ERROR_NOT_IMPLEMENTED;
  183. }
  184.  
  185. /* void stop (in nsISupports aLoadCookie); */
  186. NS_IMETHODIMP nsURILoader::Stop(nsISupports *aLoadCookie)
  187. {
  188.     return NS_ERROR_NOT_IMPLEMENTED;
  189. }
  190.  
  191. /* End of implementation class template. */
  192. #endif
  193.  
  194.  
  195. #endif /* __gen_nsIURILoader_h__ */
  196.